.class public Lcom/htc/android/footprints/FootprintsMainActivity;
.super Landroid/app/Activity;
.source "FootprintsMainActivity.java"


# static fields
.field public static final MENU_CREATE:I = 0x2

.field public static final MENU_DELETE:I = 0x4

.field public static final MENU_EDIT:I = 0x1

.field public static final MENU_EXPORT:I = 0x3

.field public static final MENU_LIST:I = 0x0

.field public static final MENU_SETTING:I = 0x5

.field private static final PROGRESS_DIALOG:I = 0x0

.field private static final REQUEST_CHECK_SDCARD:I = 0x0

.field private static final TAG:Ljava/lang/String; = "FootprintsMainActivity"


# instance fields
.field addNewTap:Landroid/view/View;

.field end:J

.field private mConnection:Landroid/content/ServiceConnection;

.field private mObserver:Landroid/database/ContentObserver;

.field mService:Lcom/htc/android/footprints/ILocationAgentService;

.field private mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

.field private photoPanel:Landroid/widget/StepListView;

.field start:J

.field private taskBar:Lcom/htc/widget/TaskBar;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 48
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 503
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mService:Lcom/htc/android/footprints/ILocationAgentService;

    .line 504
    new-instance v0, Lcom/htc/android/footprints/FootprintsMainActivity$10;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$10;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    iput-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mConnection:Landroid/content/ServiceConnection;

    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/FootprintsMainActivity;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 48
    invoke-direct {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->checkEmpty()V

    return-void
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/FootprintsMainActivity;)Landroid/widget/StepListView;
    .locals 1
    .parameter "x0"

    .prologue
    .line 48
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    return-object v0
.end method

.method private checkEmpty()V
    .locals 9

    .prologue
    const v8, 0x7f0c007e

    const/16 v7, 0xa

    const/4 v6, -0x1

    const/4 v5, -0x2

    .line 181
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    if-nez v2, :cond_0

    .line 182
    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v2

    const v3, 0x7f030001

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v2

    iput-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    .line 184
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    new-instance v3, Lcom/htc/android/footprints/FootprintsMainActivity$4;

    invoke-direct {v3, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$4;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v2, v3}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 194
    :cond_0
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    if-eqz v2, :cond_2

    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v2}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_2

    .line 195
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    if-nez v2, :cond_1

    .line 196
    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    .line 197
    .local v0, layout:Landroid/widget/RelativeLayout;
    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v1, v5, v5}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 199
    .local v1, params:Landroid/widget/RelativeLayout$LayoutParams;
    invoke-virtual {v1, v7, v6}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V

    .line 201
    const/16 v2, 0xe

    invoke-virtual {v1, v2, v6}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V

    .line 203
    iput v7, v1, Landroid/widget/RelativeLayout$LayoutParams;->topMargin:I

    .line 204
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v0, v2, v1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 216
    .end local v0           #layout:Landroid/widget/RelativeLayout;
    .end local v1           #params:Landroid/widget/RelativeLayout$LayoutParams;
    :cond_1
    :goto_0
    return-void

    .line 208
    :cond_2
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    if-eqz v2, :cond_1

    .line 209
    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    .line 210
    .restart local v0       #layout:Landroid/widget/RelativeLayout;
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/widget/RelativeLayout;->removeView(Landroid/view/View;)V

    goto :goto_0
.end method

.method private checkLocationSetting()V
    .locals 5

    .prologue
    .line 303
    const-string v2, "location"

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/location/LocationManager;

    .line 304
    .local v1, service:Landroid/location/LocationManager;
    const-string v2, "gps"

    invoke-virtual {v1, v2}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 305
    new-instance v2, Landroid/app/AlertDialog$Builder;

    invoke-direct {v2, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v3, 0x1080027

    invoke-virtual {v2, v3}, Landroid/app/AlertDialog$Builder;->setIcon(I)Landroid/app/AlertDialog$Builder;

    move-result-object v2

    const v3, 0x7f0a0003

    invoke-virtual {v2, v3}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    move-result-object v2

    const v3, 0x7f0a0070

    invoke-virtual {v2, v3}, Landroid/app/AlertDialog$Builder;->setMessage(I)Landroid/app/AlertDialog$Builder;

    move-result-object v2

    const v3, 0x1040013

    new-instance v4, Lcom/htc/android/footprints/FootprintsMainActivity$6;

    invoke-direct {v4, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$6;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v2, v3, v4}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v2

    const v3, 0x1040009

    new-instance v4, Lcom/htc/android/footprints/FootprintsMainActivity$5;

    invoke-direct {v4, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$5;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v2, v3, v4}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    .line 324
    .local v0, dialog:Landroid/app/AlertDialog;
    invoke-virtual {v0}, Landroid/app/AlertDialog;->show()V

    .line 327
    .end local v0           #dialog:Landroid/app/AlertDialog;
    :cond_0
    return-void
.end method


# virtual methods
.method initTaskBar()V
    .locals 4

    .prologue
    const/4 v3, 0x2

    .line 334
    const v0, 0x7f0c007d

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/FootprintsMainActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/htc/widget/TaskBar;

    iput-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    .line 336
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v0, v3}, Lcom/htc/widget/TaskBar;->init(I)V

    .line 337
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    const v1, 0x7f0a0061

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/FootprintsMainActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/htc/widget/TaskBar;->setUpText(Ljava/lang/String;)V

    .line 339
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Lcom/htc/widget/TaskBar;->setCountIndicatorVisibility(I)V

    .line 340
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f020095

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/htc/widget/TaskBar;->setIcon(Landroid/graphics/drawable/Drawable;I)V

    .line 342
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f020096

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v0, v1, v3}, Lcom/htc/widget/TaskBar;->setIcon(Landroid/graphics/drawable/Drawable;I)V

    .line 346
    iget-object v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    new-instance v1, Lcom/htc/android/footprints/FootprintsMainActivity$7;

    invoke-direct {v1, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$7;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v0, v1}, Lcom/htc/widget/TaskBar;->setOnClickListener(Lcom/htc/widget/TaskBar$OnPanelClickListener;)V

    .line 366
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 8
    .parameter "savedInstanceState"

    .prologue
    const-string v7, "Sam"

    .line 63
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 64
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v2

    iput-wide v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->start:J

    .line 68
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getWindow()Landroid/view/Window;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/view/Window;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 70
    invoke-direct {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->checkLocationSetting()V

    .line 71
    const/4 v2, 0x3

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->setVolumeControlStream(I)V

    .line 72
    const/4 v2, 0x1

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->requestWindowFeature(I)Z

    .line 73
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v0

    .line 74
    .local v0, start1:J
    const v2, 0x7f030019

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->setContentView(I)V

    .line 75
    const-string v2, "Sam"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "setContentView  time "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v3

    sub-long/2addr v3, v0

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v7, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 76
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->initTaskBar()V

    .line 77
    const v2, 0x7f0c007c

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/StepListView;

    iput-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    .line 78
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    iget-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v2, v3}, Landroid/widget/StepListView;->setTaskBar(Lcom/htc/widget/TaskBar;)V

    .line 80
    new-instance v2, Lcom/htc/android/footprints/FootprintsMainActivity$1;

    new-instance v3, Landroid/os/Handler;

    invoke-direct {v3}, Landroid/os/Handler;-><init>()V

    invoke-direct {v2, p0, v3}, Lcom/htc/android/footprints/FootprintsMainActivity$1;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;Landroid/os/Handler;)V

    iput-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mObserver:Landroid/database/ContentObserver;

    .line 85
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    iget-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mObserver:Landroid/database/ContentObserver;

    invoke-virtual {v2, v3}, Landroid/widget/StepListView;->registerContentObserver(Landroid/database/ContentObserver;)V

    .line 88
    new-instance v2, Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v2, v3}, Lcom/htc/android/footprints/utils/StorageUtil;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    .line 89
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    new-instance v3, Lcom/htc/android/footprints/FootprintsMainActivity$2;

    invoke-direct {v3, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$2;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v2, v3}, Lcom/htc/android/footprints/utils/StorageUtil;->SetOnChangeStorageListerner(Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;)V

    .line 118
    const-string v2, "Sam"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "oncreate time "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v3

    iget-wide v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->start:J

    sub-long/2addr v3, v5

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v7, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 119
    return-void
.end method

.method protected onCreateDialog(I)Landroid/app/Dialog;
    .locals 3
    .parameter "id"

    .prologue
    .line 287
    packed-switch p1, :pswitch_data_0

    .line 298
    const/4 v1, 0x0

    :goto_0
    return-object v1

    .line 289
    :pswitch_0
    new-instance v0, Landroid/app/ProgressDialog;

    invoke-direct {v0, p0}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    .line 290
    .local v0, dialog:Landroid/app/ProgressDialog;
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0a0045

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setTitle(Ljava/lang/CharSequence;)V

    .line 291
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0a0071

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 293
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 294
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setCancelable(Z)V

    move-object v1, v0

    .line 295
    goto :goto_0

    .line 287
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 7
    .parameter "menu"

    .prologue
    const/4 v6, 0x4

    const/4 v5, 0x3

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 378
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a0046

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v2, v2, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    const v1, 0x7f0200e0

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 381
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a000f

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v3, v3, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    const v1, 0x7f0200b0

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 384
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a0028

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v4, v4, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    const v1, 0x7f0200be

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 387
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a0021

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v5, v5, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    const v1, 0x7f0200b0

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 390
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a0010

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v6, v6, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    const v1, 0x7f0200ae

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 396
    return v3
.end method

.method protected onDestroy()V
    .locals 5

    .prologue
    const/4 v3, 0x0

    .line 239
    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    .line 241
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    if-eqz v2, :cond_0

    .line 242
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v2, v3}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 243
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 244
    iput-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->addNewTap:Landroid/view/View;

    .line 246
    :cond_0
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    iget-object v4, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mObserver:Landroid/database/ContentObserver;

    invoke-virtual {v2, v4}, Landroid/widget/StepListView;->unregisterContentObserver(Landroid/database/ContentObserver;)V

    .line 249
    :try_start_0
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mService:Lcom/htc/android/footprints/ILocationAgentService;

    invoke-interface {v2}, Lcom/htc/android/footprints/ILocationAgentService;->isTracking()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 250
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mService:Lcom/htc/android/footprints/ILocationAgentService;

    invoke-interface {v2}, Lcom/htc/android/footprints/ILocationAgentService;->shutdownAgent()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 256
    :cond_1
    :goto_0
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {v2, v3}, Lcom/htc/android/footprints/utils/StorageUtil;->SetOnChangeStorageListerner(Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;)V

    .line 257
    iput-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    .line 258
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v2}, Landroid/widget/StepListView;->release()V

    .line 259
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v2}, Landroid/widget/StepListView;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    check-cast v2, Landroid/view/ViewGroup;

    invoke-virtual {v2}, Landroid/view/ViewGroup;->removeAllViews()V

    .line 260
    iput-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    .line 261
    iget-object v4, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    move-object v0, v3

    check-cast v0, Lcom/htc/widget/TaskBar$OnPanelClickListener;

    move-object v2, v0

    invoke-virtual {v4, v2}, Lcom/htc/widget/TaskBar;->setOnClickListener(Lcom/htc/widget/TaskBar$OnPanelClickListener;)V

    .line 262
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v2}, Lcom/htc/widget/TaskBar;->getLeftButton()Landroid/widget/ImageView;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 263
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v2}, Lcom/htc/widget/TaskBar;->getLeftButton()Landroid/widget/ImageView;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 264
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v2}, Lcom/htc/widget/TaskBar;->getRightButton()Landroid/widget/ImageView;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 265
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v2}, Lcom/htc/widget/TaskBar;->getRightButton()Landroid/widget/ImageView;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 266
    iput-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    .line 268
    return-void

    .line 252
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 253
    .local v1, e:Landroid/os/RemoteException;
    const-string v2, "FootprintsMainActivity"

    invoke-virtual {v1}, Landroid/os/RemoteException;->getMessage()Ljava/lang/String;

    move-result-object v4

    invoke-static {v2, v4, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 2
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 273
    const/4 v1, 0x4

    if-ne p1, v1, :cond_0

    .line 275
    :try_start_0
    iget-object v1, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mService:Lcom/htc/android/footprints/ILocationAgentService;

    invoke-interface {v1}, Lcom/htc/android/footprints/ILocationAgentService;->shutdownAgent()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 280
    :cond_0
    :goto_0
    invoke-super {p0, p1, p2}, Landroid/app/Activity;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v1

    return v1

    .line 276
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 277
    .local v0, e:Landroid/os/RemoteException;
    invoke-virtual {v0}, Landroid/os/RemoteException;->printStackTrace()V

    goto :goto_0
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 11
    .parameter "item"

    .prologue
    const/4 v9, 0x1

    const/4 v10, 0x0

    .line 409
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    if-nez v7, :cond_1

    .line 410
    new-instance v5, Landroid/content/Intent;

    invoke-direct {v5}, Landroid/content/Intent;-><init>()V

    .line 411
    .local v5, searchIntent:Landroid/content/Intent;
    const-class v7, Lcom/htc/android/footprints/activity/ListModeNewActivity;

    invoke-virtual {v5, p0, v7}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 414
    invoke-virtual {p0, v5}, Lcom/htc/android/footprints/FootprintsMainActivity;->startActivity(Landroid/content/Intent;)V

    .end local v5           #searchIntent:Landroid/content/Intent;
    :cond_0
    :goto_0
    move v7, v10

    .line 499
    :goto_1
    return v7

    .line 415
    :cond_1
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    if-ne v7, v9, :cond_2

    .line 416
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 417
    .local v1, editIntent:Landroid/content/Intent;
    const-string v7, "DATA"

    iget-object v8, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v8}, Landroid/widget/StepListView;->getCurrentFootprint()Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v8

    invoke-virtual {v1, v7, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 418
    const-class v7, Lcom/htc/android/footprints/activity/FootprintDetailEditActivity;

    invoke-virtual {v1, p0, v7}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 419
    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/FootprintsMainActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 420
    .end local v1           #editIntent:Landroid/content/Intent;
    :cond_2
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    const/4 v8, 0x2

    if-ne v7, v8, :cond_3

    .line 421
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 422
    .local v0, createIntent:Landroid/content/Intent;
    const-class v7, Lcom/htc/android/footprints/activity/FootprintCamera;

    invoke-virtual {v0, p0, v7}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 423
    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/FootprintsMainActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 424
    .end local v0           #createIntent:Landroid/content/Intent;
    :cond_3
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    const/4 v8, 0x4

    if-ne v7, v8, :cond_4

    .line 425
    iget-object v7, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v7}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v7

    if-nez v7, :cond_0

    .line 426
    iget-object v7, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v7}, Landroid/widget/StepListView;->getCurrentFootprint()Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v3

    .line 431
    .local v3, footprint:Lcom/htc/android/footprints/vo/Footprint;
    new-instance v7, Lcom/htc/widget/HtcAlertDialog$Builder;

    invoke-direct {v7, p0}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v8, 0x7f0a00a5

    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v7

    const v8, 0x7f0a0017

    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Lcom/htc/widget/HtcAlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v7

    const v8, 0x7f0a0065

    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->getString(I)Ljava/lang/String;

    move-result-object v8

    new-instance v9, Lcom/htc/android/footprints/FootprintsMainActivity$9;

    invoke-direct {v9, p0, v3}, Lcom/htc/android/footprints/FootprintsMainActivity$9;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;Lcom/htc/android/footprints/vo/Footprint;)V

    invoke-virtual {v7, v8, v9}, Lcom/htc/widget/HtcAlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v7

    const v8, 0x7f0a0004

    invoke-virtual {p0, v8}, Lcom/htc/android/footprints/FootprintsMainActivity;->getString(I)Ljava/lang/String;

    move-result-object v8

    new-instance v9, Lcom/htc/android/footprints/FootprintsMainActivity$8;

    invoke-direct {v9, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$8;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    invoke-virtual {v7, v8, v9}, Lcom/htc/widget/HtcAlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v7

    invoke-virtual {v7}, Lcom/htc/widget/HtcAlertDialog$Builder;->show()Lcom/htc/widget/HtcAlertDialog;

    goto/16 :goto_0

    .line 477
    .end local v3           #footprint:Lcom/htc/android/footprints/vo/Footprint;
    :cond_4
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    const/4 v8, 0x3

    if-ne v7, v8, :cond_6

    .line 478
    const-wide/32 v7, 0xe7a4

    invoke-static {v7, v8}, Lcom/htc/android/footprints/utils/StorageUtil;->isExternalStorageEnough(J)Z

    move-result v7

    if-nez v7, :cond_5

    .line 480
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f0a005f

    invoke-virtual {v7, v8}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v7

    invoke-static {p0, v7}, Lcom/htc/android/footprints/utils/FootprintUtils;->showToast(Landroid/content/Context;Ljava/lang/String;)V

    move v7, v10

    .line 483
    goto/16 :goto_1

    .line 485
    :cond_5
    iget-object v7, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v7}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v7

    if-nez v7, :cond_0

    .line 486
    iget-object v7, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v7}, Landroid/widget/StepListView;->getCurrentFootprint()Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v2

    .line 487
    .local v2, f:Lcom/htc/android/footprints/vo/Footprint;
    new-array v4, v9, [Lcom/htc/android/footprints/vo/Footprint;

    aput-object v2, v4, v10

    .line 489
    .local v4, footprints:[Lcom/htc/android/footprints/vo/Footprint;
    iget-object v7, v2, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    const-string v8, " "

    const-string v9, "_"

    invoke-virtual {v7, v8, v9}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v7

    invoke-static {p0, v7, v4}, Lcom/htc/android/footprints/utils/FootprintUtils;->exportKMZ(Landroid/app/Activity;Ljava/lang/String;[Lcom/htc/android/footprints/vo/Footprint;)V

    goto/16 :goto_0

    .line 492
    .end local v2           #f:Lcom/htc/android/footprints/vo/Footprint;
    .end local v4           #footprints:[Lcom/htc/android/footprints/vo/Footprint;
    :cond_6
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v7

    const/4 v8, 0x5

    if-ne v7, v8, :cond_0

    .line 494
    new-instance v6, Landroid/content/Intent;

    const-string v7, "ImportDialog"

    invoke-direct {v6, v7}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 495
    .local v6, testIntent:Landroid/content/Intent;
    const-string v7, "import_data"

    new-instance v8, Lcom/htc/android/footprints/vo/Footprint;

    invoke-direct {v8}, Lcom/htc/android/footprints/vo/Footprint;-><init>()V

    invoke-virtual {v6, v7, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 496
    invoke-virtual {p0, v6}, Lcom/htc/android/footprints/FootprintsMainActivity;->startActivity(Landroid/content/Intent;)V

    goto/16 :goto_0
.end method

.method protected onPause()V
    .locals 4

    .prologue
    .line 220
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 221
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    if-eqz v2, :cond_0

    .line 222
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {v2}, Lcom/htc/android/footprints/utils/StorageUtil;->closeStorgaeUtil()V

    .line 224
    :cond_0
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v2}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_1

    .line 225
    const-string v2, "Footprints"

    const/4 v3, 0x0

    invoke-virtual {p0, v2, v3}, Lcom/htc/android/footprints/FootprintsMainActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 226
    .local v1, pref:Landroid/content/SharedPreferences;
    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 228
    .local v0, editor:Landroid/content/SharedPreferences$Editor;
    const-string v2, "FOOTPRINTS_COUNT"

    iget-object v3, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v3}, Landroid/widget/StepListView;->getCount()I

    move-result v3

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 229
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 234
    .end local v0           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v1           #pref:Landroid/content/SharedPreferences;
    :cond_1
    iget-object v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mConnection:Landroid/content/ServiceConnection;

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/FootprintsMainActivity;->unbindService(Landroid/content/ServiceConnection;)V

    .line 235
    return-void
.end method

.method protected onPostResume()V
    .locals 6

    .prologue
    .line 170
    invoke-super {p0}, Landroid/app/Activity;->onPostResume()V

    .line 171
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->end:J

    .line 172
    const-string v0, "Sam"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "init tim "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-wide v2, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->end:J

    iget-wide v4, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->start:J

    sub-long/2addr v2, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 173
    return-void
.end method

.method public onPrepareOptionsMenu(Landroid/view/Menu;)Z
    .locals 4
    .parameter "menu"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

    .line 400
    invoke-interface {p1, v3}, Landroid/view/Menu;->getItem(I)Landroid/view/MenuItem;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v1}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_0

    move v1, v2

    :goto_0
    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setEnabled(Z)Landroid/view/MenuItem;

    .line 401
    const/4 v0, 0x4

    invoke-interface {p1, v0}, Landroid/view/Menu;->getItem(I)Landroid/view/MenuItem;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v1}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_1

    move v1, v2

    :goto_1
    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setEnabled(Z)Landroid/view/MenuItem;

    .line 402
    invoke-interface {p1, v2}, Landroid/view/Menu;->getItem(I)Landroid/view/MenuItem;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v1}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_2

    move v1, v2

    :goto_2
    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setEnabled(Z)Landroid/view/MenuItem;

    .line 403
    const/4 v0, 0x3

    invoke-interface {p1, v0}, Landroid/view/Menu;->getItem(I)Landroid/view/MenuItem;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v1}, Landroid/widget/StepListView;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_3

    move v1, v2

    :goto_3
    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setEnabled(Z)Landroid/view/MenuItem;

    .line 404
    return v2

    :cond_0
    move v1, v3

    .line 400
    goto :goto_0

    :cond_1
    move v1, v3

    .line 401
    goto :goto_1

    :cond_2
    move v1, v3

    .line 402
    goto :goto_2

    :cond_3
    move v1, v3

    .line 403
    goto :goto_3
.end method

.method protected onResume()V
    .locals 9

    .prologue
    const/4 v7, 0x0

    const-string v8, "DATA"

    .line 123
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 124
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v3

    .line 127
    .local v3, start:J
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    const v6, 0x7f020050

    invoke-virtual {v5, v6}, Landroid/widget/StepListView;->setBackgroundResource(I)V

    .line 129
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->taskBar:Lcom/htc/widget/TaskBar;

    invoke-virtual {v5, v7}, Lcom/htc/widget/TaskBar;->setVisibility(I)V

    .line 131
    const-string v5, "Footprints"

    invoke-virtual {p0, v5, v7}, Lcom/htc/android/footprints/FootprintsMainActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v2

    .line 132
    .local v2, pref:Landroid/content/SharedPreferences;
    const-string v5, "FOOTPRINTS_COUNT"

    invoke-interface {v2, v5, v7}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    .line 134
    .local v0, count:I
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v5}, Landroid/widget/StepListView;->getCount()I

    move-result v5

    if-eq v0, v5, :cond_0

    .line 135
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->photoPanel:Landroid/widget/StepListView;

    invoke-virtual {v5, v7}, Landroid/widget/StepListView;->setSelection(I)V

    .line 138
    :cond_0
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    if-eqz v5, :cond_1

    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {v5}, Lcom/htc/android/footprints/utils/StorageUtil;->startStorageUtil()V

    .line 140
    :cond_1
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->hasExternalStorage()Z

    move-result v5

    if-nez v5, :cond_2

    .line 142
    new-instance v1, Landroid/content/Intent;

    const-string v5, "SDCardConfirmDialog"

    invoke-direct {v1, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 143
    .local v1, intent:Landroid/content/Intent;
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->isMediaShared()Z

    move-result v5

    if-eqz v5, :cond_3

    .line 144
    const-string v5, "DATA"

    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f0a00a3

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v8, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 150
    :goto_0
    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/FootprintsMainActivity;->startActivity(Landroid/content/Intent;)V

    .line 154
    .end local v1           #intent:Landroid/content/Intent;
    :cond_2
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 155
    .restart local v1       #intent:Landroid/content/Intent;
    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v5

    const-class v6, Lcom/htc/android/footprints/service/LocationAgentService;

    invoke-virtual {v1, v5, v6}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 156
    iget-object v5, p0, Lcom/htc/android/footprints/FootprintsMainActivity;->mConnection:Landroid/content/ServiceConnection;

    const/4 v6, 0x1

    invoke-virtual {p0, v1, v5, v6}, Lcom/htc/android/footprints/FootprintsMainActivity;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    .line 159
    new-instance v5, Landroid/os/Handler;

    invoke-direct {v5}, Landroid/os/Handler;-><init>()V

    new-instance v6, Lcom/htc/android/footprints/FootprintsMainActivity$3;

    invoke-direct {v6, p0}, Lcom/htc/android/footprints/FootprintsMainActivity$3;-><init>(Lcom/htc/android/footprints/FootprintsMainActivity;)V

    const-wide/16 v7, 0x1f4

    invoke-virtual {v5, v6, v7, v8}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 165
    const-string v5, "Sam"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "resume time "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v7

    sub-long/2addr v7, v3

    invoke-virtual {v6, v7, v8}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 166
    return-void

    .line 147
    :cond_3
    const-string v5, "DATA"

    invoke-virtual {p0}, Lcom/htc/android/footprints/FootprintsMainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f0a0068

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v8, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    goto :goto_0
.end method
